---
id: 6582324b5d37fe4b622bc3c0
title: ステップ 11
challengeType: 20
dashedName: step-11
---

# --description--

Lambda functions are brief, anonymous functions in Python, ideal for simple, one-time tasks. They are defined by the `lambda` keyword, and they use the following syntax:

```py
lambda x: expr
```

In the example above, `x` is a parameter to be used in the expression `expr`. Create a `test` variable and assign it a lambda function that takes an `x` parameter and returns `x * 2`.

# --hints--

You should have `test = lambda x: x * 2` in your code.

```js
({ test: () => assert.match(code,/^test\s*=\s*lambda\s+x\s*:\s*x\s*\*\s*2/m)})
```

# --seed--

## --seed-contents--

```py
def add_expense(expenses, amount, category):
    expenses.append({'amount': amount, 'category': category})

def print_expenses(expenses):
    for expense in expenses:
        print(f'Amount: {expense["amount"]}, Category: {expense["category"]}')

def total_expenses(expenses):
    pass

--fcc-editable-region--

--fcc-editable-region--

expenses = []
```
